﻿@using Mozlite;
@using Mozlite.Web;
@using Mozlite.Common;
@using Mozlite.Web.Controls;
@using Mozlite.FileStorages;
@using Mozlite.Common.Configuration

@*
    显示导航栏
*@
@helper ShowNavigators(string key)
{
    foreach (Category category in new Category().Children)
    {
        <div>
            <div class="left-bar-menu-level-1 @if (category.Key.IsMatched(key))
                                              {<text>left-bar-leaf-item-selected</text>}">
                <a href="@category.CategoryUrl">@category.CategoryName</a>
            </div>
            @if (category.Children != null && category.Children.Count > 0)
            {
            <div class="left-bar-submenu">
                <div class="hidden" style="margin-bottom: -330px; opacity: 0; ">
                    @foreach (Category child in category.Children)
                    {
                    <div>
                        <div class="left-bar-menu-level-2 @if (category.Key.IsMatched(key))
                                              {<text>left-bar-leaf-item-selected</text>}">
                            <a href="@child.CategoryUrl">@child.CategoryName</a>
                        </div>
                    </div>
                    }
                </div>
            </div>
            }
        </div>
    }    
}

@*
 显示窗体状态信息
*@
@helper ShowDialogStatus(dynamic status)
{
    if(status.__Status != null)
    {
        if (status.__StatusType == true)
        {
        <div class="ui-state-error ui-corner-all" style="padding: 0 .7em;"> 
		    <p><span class="ui-icon ui-icon-alert" style="float: left; margin-right: .3em;"></span> 
            @status.__Status
            </p>
	    </div>
        }
        else if (status.__StatusType == false)
        {
        <div class="container">
            <div class="dialog_status">
                @status.__Status
            </div>
            <div class="tcenter">
                <button class="button" onclick="parent.closeModal(); parent.document.location.reload(); return false;">
		            @Resources.GetString("Dialog.Closed")
	            </button>
            </div>
        </div>
        }
    } 
}